<%@page import="java.util.ArrayList"%>
<%@page import="cn.edu.thsis.pojo.teacher"%>
<%@page import="java.util.List"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="cn.edu.thsis.dao.impl.jdbcUtils"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教师管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/animate.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>教师列表</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="table_basic.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a data-toggle="modal" data-target="#add">添加</a>
                        </li>
                        <li><a href="table_basic.html#">刷新</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="ibox-content">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>工号</th>
                        <th>姓名</th>
                        <th>职称</th>
                        <th>联系方式</th>
                        <th>删除</th>
                    </tr>
                    </thead>
                    <tbody>
                    <%
                    List<teacher> tealist = (ArrayList<teacher>)request.getAttribute("tealist");
                    for(teacher tea :tealist){
                    %>
                    <tr>
                        <td><%=tea.getUid()%></td>
                        <td><%=tea.getUname()%></td>
                        <td><%=tea.getTea_title()%></td>
                        <td><%=tea.getTea_tel()%></td>
                        <td><a href="${pageContext.request.contextPath}/UpdateUser?oper=deltea&id=<%=tea.getUid()%>">删除</a></td>
                    </tr>
                    <%} %>
                    </tbody>
                </table>
                <div class="modal inmodal" id="add" tabindex="-1" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-sm">
                    <form action="${pageContext.request.contextPath}/UpdateUser" method="post">
                        <input type="hidden" name="oper" value="addtea">
                        <div class="modal-content animated bounceInRight">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                                </button>
                                <h4 class="modal-title">添加教师</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form-group ">
                                <input name="uid" placeholder="工号" class="form-control"><br>
                                <input name="uname" placeholder="姓名" class="form-control"><br>
                                <input name="tea_title" placeholder="职称" class="form-control"><br>
                                <input name="tea_tel" placeholder="联系方式" class="form-control"><br></div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                <input type="submit" class="btn btn-primary">
                            </div>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
            </div>
        </div>
    </div>
<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/content.js"></script>
</body>
</html>